<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" href="./css/bootstrap.min.css" />
		<script src="./js/jquery-min.js"></script>
	</head>
	<body>
		<div>
		<h1>多选框</h1>
		爱好:
		<input type="checkbox" id="hobby" />work
		<input type="checkbox" id="hobby" />work
		<input type="checkbox" name="" id="hobby" />work </div>
		<div class="form-group" >
		<button id="selectAll"  class="btn btn-primary">全选</button>	
		<button id="unselectAll" class="btn btn-danger">全取消</button>	
		</div>
	</body>
	<script>
	//
	$("#selectAll").click(function(){
		$("[id=hobby]").attr("checked",true)})
	$("#unselectAll").click(function(){
		$("[id=hobby]").attr("checked",false)})
		
	
	</script>
</html>
